<?php
$host = "0.0.0.0";
$port = 9999;
$listen_socket = socket_create(AF_INET,SOCK_STREAM,SOL_TCP);
socket_bind($listen_socket,$host,$port);
socket_listen($listen_socket);

while (true){
   $connection_socket = socket_accept($listen_socket);
   $msg = "helloworld\r\n";
   socket_write($connection_socket,$msg,strlen($msg));
   socket_close($connection_socket);
}

socket_close($listen_socket);
